home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1999 / MacHack 1999.toast / The Hacks / DesktopDoubler / Common / Headers / MetroNubUserInterface.h < prev    next >
Encoding:
Text File  |  1999-06-22  |  3.4 KB  |  118 lines  |  [TEXT/CWIE]

  1. // ===========================================================================
  2. //    MetroNubUserInterface.h            ©1996 Metrowerks Inc. All rights reserved.
  3. // ===========================================================================
  4.  
  5. #ifndef __MetroNubUserInterface__
  6. #define __MetroNubUserInterface__
  7.  
  8. #include <ConditionalMacros.h>
  9. #include <MixedMode.h>
  10. #include <Types.h>
  11.  
  12. #if PRAGMA_ALIGN_SUPPORTED
  13. #pragma options align=mac68k
  14. #endif
  15.  
  16.  
  17. // ---------------------------------------------------------------------------
  18. //        • Constants
  19. // ---------------------------------------------------------------------------
  20.  
  21. const short kMetroNubUserAPIVersion = 1;        // current User API version
  22. const OSType kMetroNubUserSignature = 'MnUI';
  23.  
  24.  
  25. // ---------------------------------------------------------------------------
  26. //        • IsDebuggerRunning
  27. // ---------------------------------------------------------------------------
  28.  
  29. // pascal Boolean IsDebuggerRunning ();
  30.  
  31. typedef pascal Boolean (*IsDebuggerRunningProcPtr)();
  32.  
  33. #if GENERATINGCFM
  34. typedef UniversalProcPtr IsDebuggerRunningUPP;
  35. #else
  36. typedef IsDebuggerRunningProcPtr IsDebuggerRunningUPP;
  37. #endif
  38.  
  39. enum {
  40.     uppIsDebuggerRunningProcInfo = kPascalStackBased
  41.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  42. };
  43.  
  44. #if GENERATINGCFM
  45. #define NewIsDebuggerRunningProc(userRoutine)        \
  46.         (IsDebuggerRunningUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppIsDebuggerRunningProcInfo, GetCurrentArchitecture())
  47. #else
  48. #define NewIsDebuggerRunningProc(userRoutine)        \
  49.         ((IsDebuggerRunningUPP) (userRoutine))
  50. #endif
  51.  
  52. #if GENERATINGCFM
  53. #define CallIsDebuggerRunningProc(userRoutine)        \
  54.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppIsDebuggerRunningProcInfo)
  55. #else
  56. #define CallIsDebuggerRunningProc(userRoutine)        \
  57.             (*(userRoutine))()
  58. #endif
  59.  
  60.  
  61. // ---------------------------------------------------------------------------
  62. //        • AmIBeingDebugged
  63. // ---------------------------------------------------------------------------
  64.  
  65. // pascal Boolean AmIBeingDebugged ();
  66.  
  67. typedef pascal Boolean (*AmIBeingDebuggedProcPtr)();
  68.  
  69. #if GENERATINGCFM
  70. typedef UniversalProcPtr AmIBeingDebuggedUPP;
  71. #else
  72. typedef AmIBeingDebuggedProcPtr AmIBeingDebuggedUPP;
  73. #endif
  74.  
  75. enum {
  76.     uppAmIBeingDebuggedProcInfo = kPascalStackBased
  77.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  78. };
  79.  
  80. #if GENERATINGCFM
  81. #define NewAmIBeingDebuggedProc(userRoutine)        \
  82.         (AmIBeingDebuggedUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppAmIBeingDebuggedProcInfo, GetCurrentArchitecture())
  83. #else
  84. #define NewAmIBeingDebuggedProc(userRoutine)        \
  85.         ((AmIBeingDebuggedUPP) (userRoutine))
  86. #endif
  87.  
  88. #if GENERATINGCFM
  89. #define CallAmIBeingDebuggedProc(userRoutine)        \
  90.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppAmIBeingDebuggedProcInfo)
  91. #else
  92. #define CallAmIBeingDebuggedProc(userRoutine)        \
  93.             (*(userRoutine))()
  94. #endif
  95.  
  96.  
  97. // ---------------------------------------------------------------------------
  98. //        • MetroNubUserEntryBlock
  99. // ---------------------------------------------------------------------------
  100.  
  101. struct MetroNubUserEntryBlock
  102. {
  103.     long                    blockLength;        // length of this block
  104.     short                    apiLowVersion;        // lowest supported version of the Nub API
  105.     short                    apiHiVersion;        // highest supported version of the Nub API
  106.     Str31                    nubVersion;            // short version string from 'vers' 1 resource
  107.         
  108.     IsDebuggerRunningUPP    isDebuggerRunning;
  109.     AmIBeingDebuggedUPP        amIBeingDebugged;
  110. };
  111. typedef struct MetroNubUserEntryBlock MetroNubUserEntryBlock;
  112.  
  113.  
  114. #if PRAGMA_ALIGN_SUPPORTED
  115. #pragma options align=reset
  116. #endif
  117.  
  118. #endif